<!--
 * @author: Goalias
 * @since: 2025-01-03
-->
<script setup lang="ts">
import { ref } from 'vue'
import { Histogram, Setting, Management, Promotion } from '@element-plus/icons-vue'
import TypingAnimation from '@/components/ui/TypingAnimation'

</script>

<template>
    <div class="manager-container">
        <el-container class="layout-container">
            <el-aside width="200px">
                <el-scrollbar>
                    <el-menu :default-openeds="['1']">
                        <el-sub-menu index="1">
                            <template #title>
                                <el-icon>
                                    <Histogram />
                                </el-icon>服务监控
                            </template>
                            <el-menu-item-group>
                                <RouterLink :to="{ path: '/manager/' }">
                                    <el-menu-item index="0">
                                        系统概况
                                    </el-menu-item>
                                </RouterLink>
                            </el-menu-item-group>
                            <el-menu-item-group>
                                <el-sub-menu index="1-1">
                                    <template #title>user-manager</template>
                                    <RouterLink :to="{ path: '/manager/sql', query: { 'project': 'user' } }">
                                        <el-menu-item index="1-1-1">
                                            🟤 sql监控
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/webUri', query: { 'project': 'user' } }">
                                        <el-menu-item index="1-1-2">
                                            🔴 web流量
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/health', query: { 'project': 'user' } }">
                                        <el-menu-item index="1-1-3">
                                            🟢 健康监控
                                        </el-menu-item>
                                    </RouterLink>
                                </el-sub-menu>
                            </el-menu-item-group>
                            <el-menu-item-group>
                                <el-sub-menu index="1-2">
                                    <template #title>content-integration</template>
                                    <RouterLink :to="{ path: '/manager/sql', query: { 'project': 'content' } }">
                                        <el-menu-item index="1-2-1">
                                            🟤 sql监控
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/webUri', query: { 'project': 'content' } }">
                                        <el-menu-item index="1-2-2">
                                            🔴 web流量
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/health', query: { 'project': 'content' } }">
                                        <el-menu-item index="1-2-3">
                                            🟢 健康监控
                                        </el-menu-item>
                                    </RouterLink>
                                </el-sub-menu>
                            </el-menu-item-group>
                            <el-menu-item-group>
                                <el-sub-menu index="1-3">
                                    <template #title>ability-expansion</template>
                                    <RouterLink :to="{ path: '/manager/sql', query: { 'project': 'ability' } }">
                                        <el-menu-item index="1-3-1">
                                            🟤 sql监控
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/webUri', query: { 'project': 'ability' } }">
                                        <el-menu-item index="1-3-2">
                                            🔴 web流量
                                        </el-menu-item>
                                    </RouterLink>
                                    <RouterLink :to="{ path: '/manager/health', query: { 'project': 'ability' } }">
                                        <el-menu-item index="1-3-3">
                                            🟢 健康监控
                                        </el-menu-item>
                                    </RouterLink>
                                </el-sub-menu>
                            </el-menu-item-group>
                        </el-sub-menu>
                        <el-sub-menu index="2">
                            <template #title>
                                <el-icon>
                                    <Management />
                                </el-icon>内容管理
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="2-1">
                                    <RouterLink :to="{ path: '/manager/article' }">🟣 博客创作</RouterLink>
                                </el-menu-item>
                                <el-menu-item index="2-2">
                                    <RouterLink :to="{ path: '/manager/draft' }">🟠 文章管理</RouterLink>
                                </el-menu-item>
                                <el-menu-item index="2-3">
                                    <RouterLink :to="{ path: '/manager/life' }">🟡 生活点滴</RouterLink>
                                </el-menu-item>
                                <el-menu-item index="2-4">
                                    <RouterLink :to="{ path: '/manager/mark' }">🔵 随手记录</RouterLink>
                                </el-menu-item>
                                <el-menu-item index="2-5">
                                    <RouterLink :to="{ path: '/manager/link' }">⚫ 友链共享</RouterLink>
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-sub-menu>
                    </el-menu>
                </el-scrollbar>
            </el-aside>

            <el-container>
                <el-header>
                    <div>
                        <TypingAnimation text="🥰 创造属于自己的世界，勇敢去做每一个梦 < Code with Passion > ❣" :duration="150" className="descHeader" />
                    </div>
                    <div class="toolbar">
                        <RouterLink :to="{ path: '/' }">
                            <el-icon>
                                <Promotion />
                            </el-icon>
                            <span>返回主页</span>
                        </RouterLink>
                    </div>
                </el-header>

                <el-main>
                    <el-scrollbar>
                        <RouterView />
                    </el-scrollbar>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<style scoped>
.layout-container {
    height: 100vh;
    width: 100vw;
}

.layout-container .el-header {
    position: relative;
    background: rgb(0, 158, 147);
    color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 10vh;
}

.layout-container .descHeader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin-left: 2vw;
    font-size: 2vw;
    color: var(--theme-color);
}

.layout-container .toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin-right: 2vw;
    font-size: 1.5vw;
}

.layout-container .el-aside {
    color: var(--theme-color);
    background: rgb(0, 158, 147);
    width: 13vw;
}

.layout-container .el-menu {
    border-right: none;
    background-color: rgb(52, 255, 255);
    width: 13vw;


    :deep(.el-menu-item) {
        width: 13vw;
        font-size: 16px;
        color: var(--theme-color);
        background-color: rgb(181, 255, 255);
    }

    :deep(.el-sub-menu__title) {
        width: 13vw;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: medium;
    }
}


.layout-container .el-main {
    padding: 0;
}
</style>
